﻿using Util;
using Util.Ui;
using Util.Ui.Configs;
using Util.Ui.Grids;

namespace Applications.Presentation.Extensions.GridColumns
{
    /// <summary>
    /// 表格列业务控件扩展
    /// </summary>
    public static class BusinessGridColumnExtensions
    {
        /// <summary>
        /// 附件预览
        /// </summary>
        public static IDataGridColumn AttachmentPreview(this IDataGridColumn gridColumn)
        {
            return gridColumn.Format("parent.main_attachment_preview").Align(AlignLeftRigthCenter.Center, AlignLeftRigthCenter.Center);
        }

        /// <summary>
        /// 根据是否启用格式化
        /// </summary>
        public static IDataGridColumn FormatByEnabled(this IDataGridColumn gridColumn)
        {
            return gridColumn.Format("parent.main_format_by_enabled");
        }
    }
}
